package yu.code.yurpc.registry;

import yu.code.yurpc.model.ServiceMetaInfo;

import java.util.List;

/**
 * 本地注册中心缓存
 */
public class RegistryServiceCache {
    public List<ServiceMetaInfo> serviceMetaInfoList;
    /**
     * 写缓存
     *
     * @param serviceMetaInfoList
     */
    public void writeCache(List<ServiceMetaInfo> serviceMetaInfoList) {
        this.serviceMetaInfoList = serviceMetaInfoList;
    }

    /**
     * 读缓存
     *
     * @return
     */
    public List<ServiceMetaInfo> readCache() {
        return serviceMetaInfoList;
    }

    /**
     * 清除缓存
     */
    public void clearCache() {
        serviceMetaInfoList = null;
    }
}
